package xcmg.device.util;

public class RedisConstant {

    public class RedisKeyContant{
        //同步sap零件信息redisson锁控制，缓存key前缀
        public static final String SYS_SAP_MATERIALS_INFO_CACHE_KEY = "SYN_SAP_MATERIALS_INFO_CACHE_KEY_";
        //pda扫码入库redisson锁控制，缓存key前缀
        public static final String PDA_INBOUND_BARCODE_CACHE_KEY = "PDA_OUTBOUND_INBOUND_BARCODE_CACHE_KEY_";
        //PDA扫码出库redisson锁控制，缓存key前缀
        public static final String PDA_OUTBOUND_BARCODE_CACHE_KEY = "PDA_OUTBOUND_BARCODE_CACHE_KEY_";
        //非条码入库redisson锁控制，缓存key前缀
        public static final String NOBARCODE_INBOUND_BUSINESSORDER_CACHE_KEY = "NOBARCODE_INBOUND_BUSINESSORDER_CACHE_KEY_";
        //非条码出库redisson锁控制，缓存key前缀
        public static final String NOBARCODE_OUTBOUND_BUSINESSORDER_CACHE_KEY = "NOBARCODE_OUTBOUND_BUSINESSORDER_CACHE_KEY_";

        public static final String INITIALINVENTORY_AUTOINBOUND_BILLNO_CACHE_KEY = "INITIALINVENTORY_AUTOINBOUND_BILLNO_CACHE_KEY_";
        //创建销售意向单重复点击加锁控制，缓存key前缀
        public static final String SALE_INTENTION_CREATE_LOCK_KEY = "SALE_INTENTION_CREATE_LOCK_KEY_";

        public static final String PURCHASE_REQUEST_SAVE_METHOD = "purchase-reqeust-save";
    }
    //出入库操作锁时间
    public static final Long OUT_INBOUND_LOCK_TIME = 60 * 5L;
    //期初入库操作锁时间
    public static final Long INITIALINVENTORY_INBOUND_LOCK_TIME = 60 * 30L;
    //创建销售意向单重复点击加锁控制时锁的时间
    public static final Long SALE_INTENTION_CREATE_LOCK_OUTTIME = 60 * 5L;

    public static final String purchaseReuestCacheKey(Object reqeustParam){
        String suffix = ReqDedupHelper.dedupParamMD5(reqeustParam, "createDate");
        String result = RedisKeyContant.PURCHASE_REQUEST_SAVE_METHOD + "-"+suffix;
        return result;
    }
}
